Skip to content

Remove use of brace expansion, which isn't defined in POSIX - #350

Merged
alerque merged 1 commit into
RichiH:mainfrom
darkrain42:no-brace-expansion
Dec 28, 2025
Merged

alerque merged 1 commit into
RichiH:mainfrom
darkrain42:no-brace-expansion

Conversation

@darkrain42

Copy link
Copy Markdown
Contributor

This breaks when vcsh's shell is /bin/sh (as in vcsh-standalone.sh) and /bin/sh is dash (as is default in Debian and Ubuntu).

root@be86826c025e:~# ./vcsh-standalone.sh write-gitignore demo
vcsh-standalone.sh: info: '/root/.gitignore.d/demo' differs from new data, moving it to '/root/.gitignore.d/demo.bak'
mv: missing destination file operand after '/root/.gitignore.d/demo{,.bak}'
Try 'mv --help' for more information.
vcsh-standalone.sh: fatal: could not move '/root/.gitignore.d/demo' to '/root/.gitignore.d/demo.bak'
root@be86826c025e:~#

This breaks when vcsh's shell is /bin/sh (as in vcsh-standalone.sh) and
/bin/sh is dash (as is default in Debian and Ubuntu).

```
root@be86826c025e:~# ./vcsh-standalone.sh write-gitignore demo
vcsh-standalone.sh: info: '/root/.gitignore.d/demo' differs from new data, moving it to '/root/.gitignore.d/demo.bak'
mv: missing destination file operand after '/root/.gitignore.d/demo{,.bak}'
Try 'mv --help' for more information.
vcsh-standalone.sh: fatal: could not move '/root/.gitignore.d/demo' to '/root/.gitignore.d/demo.bak'
root@be86826c025e:~#
```
@alerque

alerque commented Dec 28, 2025

Copy link
Copy Markdown
Collaborator

Thank you for this fix. I've tested in dash and others, but clearly not all the code paths have gotten exercised. We're definitely targeting as limited a POSIX shell environment as we can for maximum portability.

@alerque
alerque merged commit 6055d99 into RichiH:main Dec 28, 2025
5 checks passed
@alerque

alerque commented Dec 28, 2025

Copy link
Copy Markdown
Collaborator

Do we need a patch release put out for this? Are you working on Debian packaging or anything like that?

I'd like to get #349 addressed before another release but ran into some funny cart-horse scenario in the latest GNU Autotools release that I haven't had time to ferret out.

@darkrain42

Copy link
Copy Markdown
Contributor Author

Do we need a patch release put out for this? Are you working on Debian packaging or anything like that?

I don't think it's urgent; this has been broken for quite a while (introduced in aeae010).

The Debian-packaged version of vcsh has a shebang of #!/bin/bash, so isn't affected by this problem -- it's unique(?) to the standalone version.

@darkrain42
darkrain42 deleted the no-brace-expansion branch December 28, 2025 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants